package com.vilicode.bean;

import lombok.Data;

@Data
public class User {  
	private Integer uid;
	private String uname;
	private String upwd;
	private String urealname;
	private Integer urole;
	private String umark;
	private String uphone;
	private String uaddress;
	private boolean isadmin=false;

	public boolean isAdmin()
	{
		return urole==0;
	}

	public boolean isIsadmin() {
		return isadmin;
	}

	public void setUrole(Integer urole) {
		this.urole = urole;
		isadmin=urole==0?true:false;
	}

	@Override
	public String toString() {
		return "User{" +
				"uid=" + uid +
				", uname='" + uname + '\'' +
				", upwd='" + upwd + '\'' +
				", urealname='" + urealname + '\'' +
				", urole=" + urole +
				", umark='" + umark + '\'' +
				", uphone='" + uphone + '\'' +
				", uaddress='" + uaddress + '\'' +
				'}';
	}
}
